
function teamselect( ply, com, args )
	if args[1] == "blue" then
		ply:SetTeam( 1 )
		ply:Spectate( OBS_MODE_NONE )
		ply:KillSilent()
	elseif args[1] == "red" then
		ply:SetTeam( 2 )
		ply:Spectate( OBS_MODE_NONE )
		ply:KillSilent()
	end
end
concommand.Add("dm_team",teamselect)

function classchange( ply, com, args )
	sql.Begin()
		ply:SetPData("class",args[1])
	sql.Commit()
	ply:SetNetworkedString("class",args[1])
	if args[1] == "soldier" then
		local rand = math.random(1,9)
		util.PrecacheModel( "models/Humans/Group03/Male_0"..rand..".mdl" )
		ply:SetModel( "models/Humans/Group03/Male_0"..rand..".mdl" )
		
	elseif args[1] == "support" then
		local rand = math.random(1,7)
		util.PrecacheModel( "models/Humans/Group03m/Male_0"..rand..".mdl" )
		ply:SetModel( "models/Humans/Group03m/Male_0"..rand..".mdl" )
		
	elseif args[1] == "assassin" then
		local rand = math.random(1,4)*2
		util.PrecacheModel( "models/Humans/Group02/Male_0"..rand..".mdl" )
		ply:SetModel( "models/Humans/Group02/Male_0"..rand..".mdl" )
		
	elseif args[1] == "marksman" then
		local rand = math.random(1,9)
		util.PrecacheModel( "models/Humans/Group01/Male_0"..rand..".mdl" )
		ply:SetModel( "models/Humans/Group01/Male_0"..rand..".mdl" )
	end
	ply:SetNetworkedInt("new", 0)
	ply:KillSilent()
end

concommand.Add("dm_classchange",classchange)